package com.example.controller;

import com.example.bean.User;
import com.example.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
 * Created by Renzhiping on 2018/1/12.
 */
@RestController
public class Myproject {
    @Autowired
    private UserService userService;

    @RequestMapping("/")
   public Object say( HttpServletRequest request){
        Object sb = request.getAttribute("sb");
        return sb.toString();
    }
    @RequestMapping("/**/{url}")
    public String aa(HttpServletRequest request){
        Object sb = request.getAttribute("sb");
        return sb.toString();
    }

    @RequestMapping("/find")
    public User find(Long id){
        return userService.getUserById(id);
    }

}
